feat(solana-indexer) PR 9: cover the ingester to decoder pipeline end to end - #4677
feat(solana-indexer) PR 9: cover the ingester to decoder pipeline end to end#4677squadgazzz wants to merge 5 commits into
Conversation
|
Claude finished @squadgazzz's task in 4m 0s —— View job PR Review — solana-indexer PR 9
Verdict: Looks good. The test harness and the end-to-end pipeline test are clean, correct, and well-documented. What I checked:
One optional coverage note posted inline: the harness now records |
| assert_eq!( | ||
| persistence.calls(), | ||
| vec![Call::PersistEvents { | ||
| events: vec![DecodedEvent::Settlement(SettlementEvent::OrderCreated { | ||
| order_uid: expected_uid, | ||
| owner: Pubkey::new_from_array([0x11; 32]), | ||
| created_by, | ||
| })], | ||
| watermark: Slot(41), | ||
| }] | ||
| ); | ||
| } |
There was a problem hiding this comment.
Optional (coverage): this new harness records three Call variants, but only PersistEvents is ever asserted. The Watermark path (events.is_empty() → write_watermark) and the DeadLetter path (decode_failed → write_dead_letter) in Decoder::run are still unobserved end-to-end — decode_wraps_events_and_skips_reverted_transactions exercises the reverted/empty case at the decode() level but not through run(), so the slot - 1 watermark write for an empty transaction and the dead-letter write are never pinned.
Since the seam now makes both observable for free, consider a second pipeline case (e.g. a reverted tx → Call::Watermark(Slot(41)), and an unknown-discriminator tx → a trailing Call::DeadLetter { .. }). Not blocking for this PR's stated scope.
Description
Nothing exercised the ingester and the decoder as one pipeline, because the per-component tests stop at the channel boundary. This runs a proto
SubscribeUpdatecarrying aCreateOrderthrough the real ingester, channel and decoder, then asserts what arrived at the persistence seam.Changes
Persistencerecords every write as aCallunder#[cfg(test)]. The log is shared across clones, so a test hands one clone to a component and reads back what that component wrote.stream::iterintoIngester, through the channel, intoDecoder::run, and asserts the decoder persisted theOrderCreatedevent with watermark 41 for a slot-42 transaction. That also pins theslot - 1watermark rule across the whole path.How to test
New unit test.
Related issues
Stacked on #4676.